import 'dart:async';
import 'package:rxdart/rxdart.dart';

class CountBLoC {
  int _count = 0;

//  var _controller = StreamController<int>.broadcast();

  var _controller = BehaviorSubject<int>();

  Stream<int> get stream => _controller.stream;

  int get value => _count;

  increment() {
    _controller.sink.add(++_count);
  }

  dispose() {
    _controller.close();
  }
}

CountBLoC bLoC = CountBLoC();
